package com.ruoyi.system.mapper;

import java.util.HashMap;
import java.util.List;
import com.ruoyi.system.domain.Purchase;

/**
 * 采购单Mapper接口
 * 
 * @author ruoyi
 * @date 2021-05-06
 */
public interface PurchaseMapper 
{
    /**
     * 查询采购单
     * 
     * @param id 采购单ID
     * @return 采购单
     */
    public Purchase selectPurchaseById(Long id);

    /**
     * 查询采购单列表
     * 
     * @param purchase 采购单
     * @return 采购单集合
     */
    public List<Purchase> selectPurchaseList(Purchase purchase);

    /**
     * 新增采购单
     * 
     * @param purchase 采购单
     * @return 结果
     */
    public int insertPurchase(Purchase purchase);

    /**
     * 修改采购单
     * 
     * @param purchase 采购单
     * @return 结果
     */
    public int updatePurchase(Purchase purchase);

    /**
     * 删除采购单
     * 
     * @param id 采购单ID
     * @return 结果
     */
    public int deletePurchaseById(Long id);

    /**
     * 批量删除采购单
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deletePurchaseByIds(Long[] ids);

    Double getShipping(long pro_id);

    int deleteMat(long id);


    void deleteAllMat(long id);

    //根据pur查询
    Purchase selectPurchaseByPurId(Long purId);

    //插入库单材料
    int addIntoMat(HashMap<String, Long> map);

    //插入出库单材料
    int addOutMat(HashMap<String, Long> map);


    //查看入库单里材料是否都已经入库
    int selectInstate(Long pur_id);


    //修改请购单材料状态
    void updateState(Long id);

    //修改请购单材料状态
    void updateReqState(long id);


    //删除所有生成的出入库单
    void deleteAllWareHouring(Long id);

    int stateOfPurchase(Long pur_id);
}
